<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        width: 500px;
        height: 400px;
        border: 1px solid #000;
        margin: 50px auto;
        /* background-image: linear-gradient(to right, red, yellow, green); */
        /* background-image: linear-gradient(to right bottom, #2cc585, #3972c1); */
        /* background-image: linear-gradient(0deg, red, yellow, green); */

        /* background-image: linear-gradient(
          to right,
          red 0%,
          yellow 80%,
          green 100%
        ); */

        /* background-image: linear-gradient(
          to bottom,
          black 0%,
          black 33%,
          red 33%,
          red 67%,
          gold 67%,
          gold 100%
        ); */
        /* background-size: 50% 50%;
        background-repeat: no-repeat; */

        /* background-image: linear-gradient(
          to bottom,
          red 0%,
          red 50%,
          white 50%,
          white 100%
        );
        background-size: 100% 10%; */

        background-image: repeating-linear-gradient(
          to bottom,
          red 0%,
          red 5%,
          white 5%,
          white 10%
        );
      }
    </style>
  </head>
  <body>
    <div></div>
  </body>
</html>

<!-- 
  渐变色的属性是background-image，而不是background-color

  linear-gradient()是线性渐变的功能函数

  linear-gradient(to direction, color1, color2, color3 ....)

  对角线渐变
    linear-gradient(to right bottom, color1, color2, color3 ....)

  角度渐变
    linear-gradient(角度, color1, color2, color3 ....)
    角度deg

  不均匀渐变
    linear-gradient(to direction, color1 0%, color2 50%, color3 100%)

  重复渐变
    repeating-linear-gradient(to direction, color1 0%, color2 50%, color3 100%)
 -->
